


//订单状态列表
export const get_order_status_list = () => {
  return [
    { name: '全部', status: 'all' },
    { name: '待付款', status: 'pending' },
    // { name: '服务中', status: 'processing' },
    { name: '已退回', status: 'returned' },
    { name: '已完成', status: 'completed' },
    // { name: '已取消', status: 'canceled' },
  ]
}

export const get_order_map = () => {
  // 方法2：使用 forEach 转换（易理解，适合新手）
  const statusList = get_order_status_list();
  let statusMap: any = {};
  statusList.forEach(item => {
    statusMap[item.status] = item.name;
  });
  return statusMap;
}

export const get_status_config = (status: string) => {
  switch (status) {
    case 'all':
      return { text: '服务中', class: 'all' };
    case 'pending':
      return { text: '待付款', class: 'pending' };
    case 'processing':
      return { text: '服务中', class: 'processing' };
    case 'returned':
      return { text: '已退回', class: 'returned' };
    case 'completed':
      return { text: '已完成', class: 'completed' };
    case 'canceled':
      return { text: '已取消', class: 'canceled' };

    default:
      return { text: '未知', class: 'unknown' }
  }
}


export const get_pay_status_text = (str: string) => {
  // '已支付paid' : '未支付unpaid'
  switch (str) {
    case 'paid': return '已支付';
    case 'unpaid': return '未支付';
    default: return '未知状态';
  }
}

//根据状态获取状态文本
export const get_order_status_Text = (status: string) => {
  switch (status) {
    case 'all': return '全部';
    case 'pending': return '待付款';
    case 'processing': return '服务中';
    case 'returned': return '已退回';
    case 'completed': return '已完成';
    case 'canceled': return '已取消';
    default: return '未知状态';
  }
};


export const get_device_status_Text = (status: string) => {
  switch (status) {
    case 'run': return '运行中';
    case 'stop': return '已停止';
    default: return '未知状态';
  }
};

/**
 * 根据状态获取状态文本
 * @param {number} status - 订单状态码（1-服务中，2-已完成，3-已退回）
 * @returns {string} 状态文本
 */
export const getStatusText = (status) => {
  switch (status) {
    case 1: return '服务中';
    case 2: return '已完成';
    case 3: return '已退回';
    default: return '未知状态';
  }
};

/**
 * 根据状态获取样式类名
 * @param {number} status - 订单状态码
 * @returns {string} 样式类名
 */
export const getStatusClass = (status) => {
  switch (status) {
    case 1: return 'processing';
    case 2: return 'completed';
    case 3: return 'returned';
    default: return 'unknown';
  }
};

/**
 * 根据状态获取状态描述
 * @param {number} status - 订单状态码
 * @returns {string} 状态描述
 */
export const getStatusDesc = (status) => {
  switch (status) {
    case 1: return '服务人员正在提供服务';
    case 2: return '订单已完成服务';
    case 3: return '订单已退回，服务终止';
    default: return '订单状态未知';
  }
};

/**
 * 获取主要操作按钮文本
 * @returns {string} 按钮文本
 */
export const getPrimaryButtonText = (orderInfo) => {
  switch (orderInfo.value.status) {
    case 1: return '完成服务';
    case 3: return '重新服务';
    default: return '查看详情';
  }
};


export const infoGroups_enum = {
  commerce: {
    main: "服务商信息",
    cell: [
      { title: "服务商名称", content: "康乐养老服务有限公司" },
      { title: "负责人", content: "李经理" },
      { title: "位置", content: "上海市静安区南京西路1266号" },
      { title: "营业时间", content: "09:00-18:30" },
      { title: "联系电话", content: "021-61234567" },
      { title: "服务范围", content: "专业护理、康复训练、日间照料" },
      { title: "修改", content: "", link: 'commerce_setting_updateInfo' }
    ]
  },
  oldman: {
    main: "帮助",
    cell: [
      { title: "紧急联系", content: "立即呼叫", btnColor: "red" },
      // { title: "健康状态", content: "",link:true }
    ]
  }

}

export const doctor_cell_list = [
  { class1: "hospital-icon", class2: "icon-yiyuan2", title: "所属医院", "desc": "北京协和医院" },
  { class1: "department-icon", class2: "icon-home-heart-line", title: "所属科室", "desc": "心内科" },
]

export const defualt_grid_items = [
  {
    iconClass: 'order-icon',
    iconName: 'icon-xiadan4',
    text: '一日三餐',
    pathName: "common_pointsSupermarket",
    name: "yiri_cansan"
  },
  {
    iconClass: 'urgent-icon',
    iconName: 'icon-yijian',
    text: '生活照料',
    pathName: "family_lifeCare",
    name: "yiri_cansan"
  },
  {
    iconClass: 'dispatch-icon',
    iconName: 'icon-paidan1',
    text: '健康管家',
	pathName:"family_healthManager"
  },
  {
    iconClass: 'onsite-icon',
    iconName: 'icon-xiadan4',
    text: '智慧设备',
	pathName:"family_deviceList"
  },
  {
    iconClass: 'data-icon',
    iconName: 'icon-paidan1',
    text: '工单服务',
    pathName:"common_family_serviceList"
  },
  {
    iconClass: 'record-icon',
    iconName: 'icon-fuwujilu-',
    text: '家',
    pathName:"family_elderList"
  },
  {
    iconClass: 'data-icon',
    iconName: 'icon-shenghuofuwu1',
    text: '志愿者服务',
    pathName:"zhiyuanzhe_fuwu"
  },
  {
    iconClass: 'record-icon',
    iconName: 'icon-wode-woshifuwushang',
    text: '商超服务',
    pathName: "common_pointsSupermarket",
    name: "shenghuo_lei"
  },
  // {
  //   iconClass: 'record-icon',
  //   iconName: 'icon-yisheng',
  //   text: '医生管理'
  // },
  {
    iconClass: 'record-icon',
    iconName: 'icon-004laba-3',
    text: '告警信息',
    pathName:"gaojing_xinxi"
  },
  {
    iconClass: 'record-icon',
    iconName: 'icon-home-heart-line',
    text: '健康咨询',
    pathName:"doctor_customerStatusDetail"
  }
  // {
  //   iconClass: 'record-icon',
  //   iconName: 'icon-bangzhuzhongxin',
  //   text: '账户管理'
  // }
];